#!/bin/bash

usage() {
    echo "usage: sse [--help] <command> [<args>]"
}

help() {
cat << HELP
usage: sse [--help] <command> [<args>]

These are common sse commands used in various situations:

    filelist	Collect image filelist
    extract	Extract feature descriptors
    vocabulary	Generate vocabulary
    quantize	Quantize feature
    index	Create inverted index file
    search	Sketch Search

Run 'sse <command> --help' for more information on a command.
HELP
}

if [ $# -lt 1 ]; then
    help
    exit 1
fi

SUB_COMMANDS="filelist extract vocabulary quantize index search extract_and_quantize"

if [ "${SUB_COMMANDS/"$1"}" != "${SUB_COMMANDS}" ]; then
	$*
elif [ "$1" == "-h" ]; then
	usage
elif [ "$1" == "--help" ]; then
	help
else
	echo "Unknown option: $1"
	usage
fi


